开发者

Backgroung image for a 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜