开发者

Backgroung image for a table

开发者 https://www.devze.com 2022-12-25 08:22 出处:网络
How can we integrate a picture as a background image for a tabl开发者_开发技巧e.. <table>

How can we integrate a picture as a background image for a tabl开发者_开发技巧e..

  <table>
  <tr>
  <td><textarea>Some data here.....</textarea>
  </td>
   <td></td>
  </tr>
  <tr>
  <td><textarea>Some data here.....</textarea>
  </td>
   <td></td>
  </tr>

Thanks..


Are you asking how to assign a background image to a table? Like for any other HTML element.

In CSS:

table.mytable
 { background-image: url(your_image.gif); }

In HTML:

<table class="mytable">

Reference:

background-image property at w3schools

see that page for the additional parameters background-repeat and background-position.


table {
    background-image: url(/images/foo.png);
}


following on from Pekka's example.

table.mytable td
 { background-image: url(your_image.gif); }

would let you put a background image in each cell

if you applied a class attribute to the <td class="myClass"> you could then add a custom background to individual cells.


inline css like - style="background-image: url(your_image.gif);" - is not quite good.

in my opinion best way to put bg to table is ;

html : table > tr > td.wide

css : table tr td.wide{background:#ffffff url(/images/bg.png) repeat;}

0

精彩评论

暂无评论...
验证码 换一张
取 消