Solved

Align tablecell controls

Posted on 2007-03-27
3
1,208 Views
Last Modified: 2008-01-09
Hi experts.

Does anyone know how to align tablecell controls horizontally using .net (VB)? i have a table cell containing two controls : a time picker and a date picker (could not find a composite control?) and would like them to appear side by side in the cell.  Would prefer not to create another table column for appearance sake and there does not seem to be a way to split a cell?

Many thanks
0
Comment
Question by:jeanniex
  • 2
3 Comments
 
LVL 3

Expert Comment

by:Saber37886661
ID: 18805328
you can try and set the table cells HorizontalAlign to HorizontalAlign.Center.
It will probably not put them side to side though, so likely you will have to wrap them in another table, but if the tables border, cellpadding and cellspacing is set to '0' then the table is not visible and it will not affect your layout.

Hope it helps
0
 
LVL 1

Author Comment

by:jeanniex
ID: 18807474
Hi.

The horizontal alignment option does not work - nor combining this with "wrap" = false.
If I put another table in the cell and add a row to this with two cells - putting one control in each, they do appear side by side but not aligned horizontally.  Modifying the horizontalalignment of these tablecells does not seem to have the desired result either.
I am doing this in VB and not in the design view as I need to be able to add rows dynamically.
Any ideas?
thanks in advance
0
 
LVL 3

Accepted Solution

by:
Saber37886661 earned 500 total points
ID: 18809466
If it helps, I always do mine in the editor/ code view and never the design mode, lol it always crashes my copy of visual studio! (even after the 255th re-install)
for me i just go:
Dim tab As New Table
Dim tr As New TableRow
Dim tc As New TableCell
tc.HorizontalAlign = HorizontalAlign.Center

but normally in c# (its alot easier in c#, the language structure is more logical(wait for the comments on that comment of mine!))

ok how about giving the table cells a CssClass, eg:
tc.CssClass() = "tdAlign"
then in your css just add
.tdAlign
{
     white-space:normal;
     text-align: center;
}
or you could add it to the top of your page.
<style>
.tdAlign
{
     white-space:normal;
     text-align: center;
}
</style>

if none of this helps, let me know, but for now, its bed time
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how to gather data from news site 6 38
ASP.NET: Validation of Viewstate MAC failed 3 105
Problem to go to Web page 2 118
Forms that calculate points for wordpress 10 19
Developer tools in browsers have been around for a while, yet they are still heavily underused by developers. Developers still fix html or CSS then refresh page to see effect, or they put alert or debugger in JavaScript and then try again and again …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
This video teaches users how to migrate an existing Wordpress website to a new domain.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question