Jump to content

Recommended Posts

W3Schools says "If the width attribute is not set, a table takes up the space it needs to display the table data. Problem: I have no width attribute but the width displayed is only a bit more than the screen width and it takes 3 rows to display the data instead of displaying all in one row. I do not have a CSS defining the width. If I define the width in the table tag as width="5000", my data iscorrectly displayed in one row. But I don't want to use this methodbecause the length of my row is variable from one user to another.

Link to post
Share on other sites

Tried it but doesn't work.Is this what you meant?<input readonly size=\"10\" style=\"white-space:nowrap;color:maroon;text-align:left\" value=\"Date\"><input readonly size=\"33\" style=\"white-space:nowrap;color:maroon;text-align:left\" value=\"Description\"><input readonly size=\"10\" style=\"white-space:nowrap;color:maroon;text-align:right\" value=\"Amount\"> <input readonly size=\"15\" style=\"white-space:nowrap;color:maroon;text-align:left\" value=\"From Account\"><input readonly size=\"15\" style=\"white-space:nowrap;color:maroon;text-align:left\" value=\"To Account\">

Link to post
Share on other sites

Just CSS:

td {   white-space: nowrap}

This makes the table be exactly as wide as the content in it, without any line breaks.

Link to post
Share on other sites

Hi mickeymouse,Could you please show me your design? I would like to know why and where have you used width="5000"...

Link to post
Share on other sites
Just CSS:
td {   white-space: nowrap}

Hi Ingolme,What is this used for? How can I use this in DIV tags? Could you please show me an example? I have never used it.
Link to post
Share on other sites
Hi Ingolme, What is this used for? How can I use this in DIV tags? Could you please show me an example? I have never used it.
All it does is prevent text from wrapping in an element. You can use it on any element.
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...