Git Product home page Git Product logo

Comments (4)

fmcarvalho avatar fmcarvalho commented on May 29, 2024

Yes you can create a nested table, but you can't do it in a fluent style, because current fluent API of HtmlFlow still not provide it.

So, the alternative solution is to make something like:

HtmlTable<T> outerTable = ...
...
HtmlTable<T> nestedTable = new HtmlTable<>(); // create a new Table
outerTable.tr().td().addChild(new HtmlTable<>()); // Add a row, with a single TD, and the nested table inside it
nested.tr(). ... // proceed to add whatever you want 

In truth with the command API you have total flexibility to add what you want. The alternative fluent API should follow the HTML grammar, but it is not completely implemented and has limitations. We have been adding new methods to the fluent API according to new needs.

Maybe we should open an Issue to collect the methods that are most used and missing in the fluent API to include that in next fixes.

from htmlflow.

fmcarvalho avatar fmcarvalho commented on May 29, 2024

@pradex Since release 2.0 of HtmlFlow we already support building nested tables in fluent way.

We add a unit test with an example of a nested table according to the use case that you presented in your original post. Check it here. It is like:

static final HtmlView nestedTable = HtmlView
    .html()
        .body()
            .table()
                .tr()
                    .attrClass("top")
                    .td()
                        .attrColspan("2")
                        .table()
                            .tr()
                                .td()
                                    .attrClass("title")
                                    .img()
                                        .attrSrc("logo.png")
                                        .attrStyle("width:100%; max-width:300px;")
                                    .º() // img
                                .º() // td
                            .º() // tr
                        .º() // table
                    .º() // td
                    .td()
                        .text("Invoice #: 123")
                        .br().º()
                        .text("Created: January 1, 2015")
                        .br().º()
                        .text("Due: February 1, 2015")
                    .º() // td
                .º() // tr
            .º() // table
        .º() // body
    .º(); // html

from htmlflow.

fmcarvalho avatar fmcarvalho commented on May 29, 2024

@pradex As you may be aware, I am the author and primary advocate for the HtmlFlow Java library. As part of my continuous endeavors, I am required to provide justification for this project to my university.

HtmlFlow serves as a versatile auxiliary tool utilized across various sectors, facilitating software development by streamlining tasks such as HTML reporting automation, web templating, and more.

If you have utilized HtmlFlow, I kindly request your testimony regarding my dedication to addressing issues, implementing new features, or otherwise aligning with your requirements and/or your company within the scope of a specific project, task, or work that utilized HtmlFlow during a certain timeframe.

Your testimony will play a crucial role in demonstrating my work to my university.

Please feel free to send your testimonial to my email address at ISEL: [email protected]

Thank you in advance for your attention and assistance.

from htmlflow.

fmcarvalho avatar fmcarvalho commented on May 29, 2024

Even if you are not currently using HtmlFlow, I kindly request your acknowledgment that I was actively engaged in maintaining, tracking issues, or new features during the time of this issue. It is imperative for me to justify my efforts on HtmlFlow during the period of this issue to my university.

I would greatly appreciate it if you could once again provide your acknowledgment to my email address at ISEL: [email protected].

Thank you in advance for your attention and assistance.

from htmlflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.