Solved

Align tablecell controls

Posted on 2007-03-27
3
1,193 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now