473,385 Members | 1,640 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Remove White space from table <td>

tusovka
23
I have a table with 6 columns

-------------------------------------------------------------
| Line | One | Two | Three | Four | Five |
-------------------------------------------------------------
| 1 | a | Two | Three | Four | Five |
-------------------------------------------------------------
| 2 | b | Two | Three | Four | Five |
-------------------------------------------------------------
| 3 | VeryLongString | Two | Three | Four | Five |
-------------------------------------------------------------
| 4 | d | Two | Three | Four | Five |
-------------------------------------------------------------

Each column has a class name. Eg ( class="col_one").
When the table is created, I can determine the length of each string.
(1,1,14,1)
Because, most of the data in that column is length (1) I would like to force a width on that particular column.
Sure the (VeryLongSting) will become (V) but I will include a button to expand the column if a user is interested in row (3).

Summary---
I'm trying to save the space and not have information pushed over to the
right due to a single long string.
How can I force a smaller <td> width.

Any other suggestion, or approaches are welcome.
Aug 21 '09 #1
6 7897
gits
5,390 Expert Mod 4TB
might be a css with the max-width property could help?

kind regards
Aug 22 '09 #2
tusovka
23
-------------------------------------------------------------
| Line | One | Two | Three | Four | Five |
-------------------------------------------------------------
| 1 | a | Two | Three | Four | Five |
-------------------------------------------------------------
| 2 | b | Two | Three | Four | Five |
-------------------------------------------------------------
| 3 | Verysd| Twdsd|Trhehee| Four | Five |
-------------------------------------------------------------
| 4 | d | Two | Three | Four | Five |
-------------------------------------------------------------

When I specify a max width the the columns width behaves as told (40px)
But the text floats over the next to columns. As a result the adjacent columns are unreadable. How do i make the text hidden after 40px.

And I'm not talking about "NOWRAP" I would like to have all text after 40px not visible.
Aug 24 '09 #3
tusovka
23
style=\"max-width: 180px; overflow:hidden; text-align: right; \"

This did the trick. But I have another issue.
Here is a sample string( /home/cs123/hw_78/Now/important/info )

Column width
|----------------------|
/home/cs123/hw_78/Now/important/info

Visible info:
|----------------------|
/home/cs123/hw_7

What I need to see is:
|----------------------|
/ow/important/info

Note, the overflow works but text_align right is not working. Or the overflow only looks at the left side. How can I make this work?
Aug 24 '09 #4
gits
5,390 Expert Mod 4TB
hmmm ... i guess you might find better help with this issue in the html/css forum? i could move this thread to that forum if you think i should? ...

kind regards
Aug 24 '09 #5
tusovka
23
I think your right. Go ahead and move it over.

Thanks for yuor help...
Aug 24 '09 #6
gits
5,390 Expert Mod 4TB
moved from the JavaScript forum - done :)

kind regards
Aug 25 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: A Web Master | last post by:
As a mean of not having to use Framesets/Frames with all the bad side effects/workarounds that come with them, I want to know if it is possible to code a scrolling veritcal bar into a table <TD> ?...
1
by: Stan Brown | last post by:
In looking over my style sheet http://www.acad.sunytccc.edu/instruct/sbrown/screen.css I see that I have identical fonts and colors set on table and td elements. Is there any reason to do this,...
3
by: Matt Adams | last post by:
I want to move the following <PRE> defintion to a css file: <TABLE><TR><TD><PRE>sample text</PRE></TD> <TD> not predefined font</TD></TR></TABLE> should be <TABLE><TR><TD class=aaa>sample...
0
by: Dean Speir | last post by:
Hoping that someone here can see the glitch I'm experiencing. I build a site for an organization in which a <TD> which recurs on most of the pages displays exactly as intended in IE, Netscape and...
1
by: neverstill | last post by:
hi- I have a table on a page there is 1 row and 2 cells cell 1 has a user control that is basically just a DataList nested in a table o fit's own. then, below that user control I have some <p>...
1
by: prefersgolfing | last post by:
I'm not using Master Pages, yet I'd like to display the contents of an HTML page within a <table><tr><td> on a .aspx. I have a lengthy guide already paginated in html. I'd like to embed the...
4
by: dropdeadster | last post by:
Trying to line up a tic-tac-toe board type grid of images using style= tags to <img inside a table TD but it's not working, I get more like a set of steps, can I get an explanation of what's wrong...
7
by: Xiaoyan | last post by:
Hi,everyone: I have a problem now. I can't get the information between the <tr><td> and </td></tr>. for example: I use this regular expression can't get it, I don't know why....
0
by: =?Utf-8?B?R3JlZw==?= | last post by:
I've created my table and alli is fine. I name my <tdtags to make them easier to identify when my table gets large. Anyway, I am naming as such: <td id="cellName" > Now, sometimes when make a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.