开发者

CSS Table Issue / Dynamic Width

开发者 https://www.devze.com 2023-02-10 06:15 出处:网络
I\'m having issues getting my table to work. I really need to figure out how to use divs more, but right now, I just need it to work.

I'm having issues getting my table to work. I really need to figure out how to use divs more, but right now, I just need it to work.

Here is what I'm doing.. i have a single table 3 column table

Column 1 contains a static text actually says "Select Account"

Column 2 contains a header title

Column 3 contains the select account name

Column 1 has a static width of 220px

Column 2 needs the header to be centered in middle of screen

Column 3 needs to grow depending on size of text

Table is 100% across screen.

Can't seem to figure out how to get it to work.. Column 1 works fine.. column 3 i have centered r开发者_StackOverflow社区ight, took out width, but middle column wont center correctly...

Any ideas? Maybe a way to do this using a div? Reason I used table is because if browser is small, don't want columns to fall under each other like they do with divs

Sample Code:

<table style="width: 100%" border="1">
  <tr>
    <td style="width: 220px;">
       <span>Please Select Your Account</span>
    </td>
    <td valign="top" align="center">
       <span>HeaderTitle(Centered)</span>
    </td>
    <td align="right">
      <span>This is a really long account name need to keep dynamic</span>
    </td>
  </tr>
</table>

For those who need it.. http://jsfiddle.net/j5C3z/6/


Please dont use f$%&*(*g tables for layout, If you put up an example of your code I can convert it to a div layout for you and explain more thoroughly...

Fixed as DIV layout: http://jsfiddle.net/Mutant_Tractor/j5C3z/2/

0

精彩评论

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