开发者

Convert a table based layout to divs with Java

开发者 https://www.devze.com 2022-12-17 02:11 出处:网络
I\'ve recently been charged with creating a Android & iphone app for work. That being said, I\'m a css/php designer-developer with a bit of javascript in the mix.

I've recently been charged with creating a Android & iphone app for work. That being said, I'm a css/php designer-developer with a bit of javascript in the mix.

I need to write a bit of Java (not javascript) that will convert a table based layout into a div based layout so that I can then have control over positioning, padding, and what not.

I see many similar post, but these post involve more "designer" oriented goals rather than functional control over positioning, layout and so on.

A good resource would be greatly appreciated as I can't seem to google an appropriate search string. My searches tend to yield more "free javascript code", "Java tutorials about making flashing banners", "How to make fading menus" and countless other ra开发者_StackOverflow中文版bbit holes that lead to wonderland.

Oh, Currently using eclipse with Android SDK & ADT plugins installed.


It would be much more easier if you have predefinied a set of rules how the conversion should actually be taken place. There is namely fairly a lot which needs to be taken into account. This is really not going to be a bit of Java.

If you're looking for an existing tool, in Adobe Dreamweaver you can do that by Modify > Convert > Tables to AP divs. But still, I question if those kind of tools provides exactly that what you need. As said, there's fairly a lot which needs to be taken into account and it's shooting in the dark without a clear set of rules/requirements.


you may have to write more than a bit of java. you will need parse the html (http://www.benmccann.com/dev-blog/java-html-parsing-library-comparison/) and walk the dom (How to search in a HTML file for some tags?). that's fairly straightforward (assuming that your html is well formed), but i suspect that turning each table element into a div will require a moderate amount of code.

as BalusC pointed out, there may be tools that can get you part of the way, so you might try to do it in two passes.

0

精彩评论

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